!function(root, factory){ if(typeof define==='function'&&define.amd){ define(['jquery'], factory); }else if(typeof exports==='object'){ factory(require('jquery')); }else{ factory(root.jQuery); }}(this, function($){ 'use strict'; $.fn.typeWatch=function(o){ var _supportedInputTypes = ['TEXT', 'TEXTAREA', 'PASSWORD', 'TEL', 'SEARCH', 'URL', 'EMAIL', 'DATETIME', 'DATE', 'MONTH', 'WEEK', 'TIME', 'DATETIME-LOCAL', 'NUMBER', 'RANGE', 'DIV']; var options=$.extend({ wait: 750, callback: function(){ }, highlight: true, captureLength: 2, allowSubmit: false, inputTypes: _supportedInputTypes }, o); function checkElement(timer, override){ var value=timer.type==='DIV' ? jQuery(timer.el).html() : jQuery(timer.el).val(); if((value.length >=options.captureLength&&value!=timer.text) || (override&&(value.length >=options.captureLength||options.allowSubmit)) || (value.length==0&&timer.text)){ timer.text=value; timer.cb.call(timer.el, value); }}; function watchElement(elem){ var elementType=(elem.type||elem.nodeName).toUpperCase(); if(jQuery.inArray(elementType, options.inputTypes) >=0){ var timer={ timer: null, text: (elementType==='DIV') ? jQuery(elem).html():jQuery(elem).val(), cb: options.callback, el: elem, type: elementType, wait: options.wait }; if(options.highlight&&elementType!=='DIV') jQuery(elem).focus(function(){ this.select(); }); var startWatch=function(evt){ var timerWait=timer.wait; var overrideBool=false; var evtElementType=elementType; if(typeof evt.keyCode!='undefined'&&evt.keyCode==13 && evtElementType!=='TEXTAREA'&&elementType!=='DIV'){ timerWait=1; overrideBool=true; } var timerCallbackFx=function(){ checkElement(timer, overrideBool) } clearTimeout(timer.timer); timer.timer=setTimeout(timerCallbackFx, timerWait); }; jQuery(elem).on('keydown paste cut input', startWatch); }}; return this.each(function(){ watchElement(this); }); };}); (function (factory){ if(typeof define==='function'&&define.amd){ define(['jquery'], factory); }else if(typeof module==='object'&&module.exports){ module.exports=function (root, jQuery){ if(jQuery===undefined){ if(typeof window!=='undefined'){ jQuery=require('jquery'); }else{ jQuery=require('jquery')(root); }} factory(jQuery); return jQuery; };}else{ factory(jQuery); }})(function ($){ "use strict"; if('undefined'===typeof $){ if('console' in window){ window.console.info('Too much lightness, Featherlight needs jQuery.'); } return; } if($.fn.jquery.match(/-ajax/)){ if('console' in window){ window.console.info('Featherlight needs regular jQuery, not the slim version.'); } return; } function Featherlight($content, config){ if(this instanceof Featherlight){ this.id=Featherlight.id++; this.setup($content, config); this.chainCallbacks(Featherlight._callbackChain); }else{ var fl=new Featherlight($content, config); fl.open(); return fl; }} var opened=[], pruneOpened=function (remove){ opened=$.grep(opened, function (fl){ return fl!==remove&&fl.$instance.closest('body').length > 0; }); return opened; }; function slice(obj, set){ var r={}; for (var key in obj){ if(key in set){ r[key]=obj[key]; delete obj[key]; }} return r; } var iFrameAttributeSet={ allow: 1, allowfullscreen: 1, frameborder: 1, height: 1, longdesc: 1, marginheight: 1, marginwidth: 1, mozallowfullscreen: 1, name: 1, referrerpolicy: 1, sandbox: 1, scrolling: 1, src: 1, srcdoc: 1, style: 1, webkitallowfullscreen: 1, width: 1 }; function parseAttrs(obj, prefix){ var attrs={}, regex=new RegExp('^' + prefix + '([A-Z])(.*)'); for (var key in obj){ var match=key.match(regex); if(match){ var dasherized=(match[1] + match[2].replace(/([A-Z])/g, '-$1')).toLowerCase(); attrs[dasherized]=obj[key]; }} return attrs; } var eventMap={ keyup: 'onKeyUp', resize: 'onResize' }; var globalEventHandler=function (event){ $.each(Featherlight.opened().reverse(), function (){ if(!event.isDefaultPrevented()){ if(false===this[eventMap[event.type]](event)){ event.preventDefault(); event.stopPropagation(); return false; }} }); }; var toggleGlobalEvents=function (set){ if(set!==Featherlight._globalHandlerInstalled){ Featherlight._globalHandlerInstalled=set; var events=$.map(eventMap, function (_, name){ return name + '.' + Featherlight.prototype.namespace; }).join(' '); $(window)[set ? 'on':'off'](events, globalEventHandler); }}; Featherlight.prototype={ constructor: Featherlight, namespace: 'featherlight', targetAttr: 'data-featherlight', variant: null, resetCss: false, background: null, openTrigger: 'click', closeTrigger: 'click', filter: null, root: 'body', openSpeed: 250, closeSpeed: 250, closeOnClick: 'background', closeOnEsc: true, closeIcon: '✕', loading: '', persist: false, otherClose: null, beforeOpen: $.noop, beforeContent: $.noop, beforeClose: $.noop, afterOpen: $.noop, afterContent: $.noop, afterClose: $.noop, onKeyUp: $.noop, onResize: $.noop, type: null, contentFilters: ['jquery', 'image', 'html', 'ajax', 'iframe', 'text'], setup: function (target, config){ if(typeof target==='object'&&target instanceof $===false&&!config){ config=target; target=undefined; } var self=$.extend(this, config, { target: target }), css = !self.resetCss ? self.namespace:self.namespace + '-reset', $background=$(self.background||[ '
', '
', '', '
' + self.loading + '
', '
', '
'].join('')), closeButtonSelector='.' + self.namespace + '-close' + (self.otherClose ? ',' + self.otherClose:''); self.$instance=$background.clone().addClass(self.variant); self.$instance.on(self.closeTrigger + '.' + self.namespace, function (event){ if(event.isDefaultPrevented()){ return; } var $target=$(event.target); if(('background'===self.closeOnClick&&$target.is('.' + self.namespace)) || 'anywhere'===self.closeOnClick || $target.closest(closeButtonSelector).length){ self.close(event); event.preventDefault(); }}); return this; }, getContent: function (){ if(this.persist!==false&&this.$content){ return this.$content; } var self=this, filters=this.constructor.contentFilters, readTargetAttr=function (name){ return self.$currentTarget&&self.$currentTarget.attr(name); }, targetValue=readTargetAttr(self.targetAttr), data=self.target||targetValue||''; var filter=filters[self.type]; if(!filter&&data in filters){ filter=filters[data]; data=self.target&&targetValue; } data=data||readTargetAttr('href')||''; if(!filter){ for (var filterName in filters){ if(self[filterName]){ filter=filters[filterName]; data=self[filterName]; }} } if(!filter){ var target=data; data=null; $.each(self.contentFilters, function (){ filter=filters[this]; if(filter.test){ data=filter.test(target); } if(!data&&filter.regex&&target.match&&target.match(filter.regex)){ data=target; } return !data; }); if(!data){ if('console' in window){ window.console.error('Featherlight: no content filter found ' + (target ? ' for "' + target + '"':' (no target specified)')); } return false; }} return filter.process.call(self, data); }, setContent: function ($content){ this.$instance.removeClass(this.namespace + '-loading'); this.$instance.toggleClass(this.namespace + '-iframe', $content.is('iframe')); this.$instance.find('.' + this.namespace + '-inner') .not($content) .slice(1).remove().end() .replaceWith($.contains(this.$instance[0], $content[0]) ? '':$content); this.$content=$content.addClass(this.namespace + '-inner'); return this; }, open: function (event){ var self=this; self.$instance.hide().appendTo(self.root); if((!event||!event.isDefaultPrevented()) && self.beforeOpen(event)!==false){ if(event){ event.preventDefault(); } var $content=self.getContent(); if($content){ opened.push(self); toggleGlobalEvents(true); self.$instance.fadeIn(self.openSpeed); self.beforeContent(event); return $.when($content) .always(function ($openendContent){ if($openendContent){ self.setContent($openendContent); self.afterContent(event); }}) .then(self.$instance.promise()) .done(function (){ self.afterOpen(event); }); }} self.$instance.detach(); return $.Deferred().reject().promise(); }, close: function (event){ var self=this, deferred=$.Deferred(); if(self.beforeClose(event)===false){ deferred.reject(); }else{ if(0===pruneOpened(self).length){ toggleGlobalEvents(false); } self.$instance.fadeOut(self.closeSpeed, function (){ self.$instance.detach(); self.afterClose(event); deferred.resolve(); }); } return deferred.promise(); }, resize: function (w, h){ if(w&&h){ this.$content.css('width', '').css('height', ''); var ratio=Math.max(w / (this.$content.parent().width() - 1), h / (this.$content.parent().height() - 1)); if(ratio > 1){ ratio=h / Math.floor(h / ratio); this.$content.css('width', '' + w / ratio + 'px').css('height', '' + h / ratio + 'px'); }} }, /* Utility function to chain callbacks [Warning: guru-level] Used be extensions that want to let users specify callbacks but also need themselves to use the callbacks. The argument 'chain' has callback names as keys and function(super, event) as values. That function is meant to call `super` at some point. */ chainCallbacks: function (chain){ for (var name in chain){ this[name]=$.proxy(chain[name], this, $.proxy(this[name], this)); }} }; $.extend(Featherlight, { id: 0, autoBind: '[data-featherlight]', defaults: Featherlight.prototype, contentFilters: { jquery: { regex: /^[#.]\w/, test: function (elem){ return elem instanceof $&&elem; }, process: function (elem){ return this.persist!==false ? $(elem):$(elem).clone(true); }}, image: { regex: /\.(png|jpg|jpeg|gif|tiff?|bmp|svg)(\?\S*)?$/i, process: function (url){ var self=this, deferred=$.Deferred(), img=new Image(), $img=$(''); img.onload=function (){ $img.naturalWidth=img.width; $img.naturalHeight=img.height; deferred.resolve($img); }; img.onerror=function (){ deferred.reject($img); }; img.src=url; return deferred.promise(); }}, html: { regex: /^\s*<[\w!][^<]*>/, process: function (html){ return $(html); }}, ajax: { regex: /./, process: function (url){ var self=this, deferred=$.Deferred(); var $container=$('
').load(url, function (response, status){ if(status!=="error"){ deferred.resolve($container.contents()); } deferred.reject(); }); return deferred.promise(); }}, iframe: { process: function (url){ var deferred=new $.Deferred(); var $content=$(''); html.attr('height', height); html.attr('width', width); if(video.type==='youtube'){ html.attr('src', '//www.youtube.com/embed/' + video.id + '?autoplay=1&rel=0&v=' + video.id); }else if(video.type==='vimeo'){ html.attr('src', '//player.vimeo.com/video/' + video.id + '?autoplay=1'); }else if(video.type==='vzaar'){ html.attr('src', '//view.vzaar.com/' + video.id + '/player?autoplay=true'); } iframe=$(html).wrap('
').insertAfter(item.find('.owl-video')); this._playing=item.addClass('owl-video-playing'); }; Video.prototype.isInFullScreen=function (){ var element=document.fullscreenElement||document.mozFullScreenElement || document.webkitFullscreenElement; return element&&$(element).parent().hasClass('owl-video-frame'); }; Video.prototype.destroy=function (){ var handler, property; this._core.$element.off('click.owl.video'); for (handler in this._handlers){ this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.owlCarousel.Constructor.Plugins.Video=Video; })(window.Zepto||window.jQuery, window, document); ; (function ($, window, document, undefined){ var Animate=function (scope){ this.core=scope; this.core.options=$.extend({}, Animate.Defaults, this.core.options); this.swapping=true; this.previous=undefined; this.next=undefined; this.handlers={ 'change.owl.carousel': $.proxy(function (e){ if(e.namespace&&e.property.name=='position'){ this.previous=this.core.current(); this.next=e.property.value; }}, this), 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function (e){ if(e.namespace){ this.swapping=e.type=='translated'; }}, this), 'translate.owl.carousel': $.proxy(function (e){ if(e.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)){ this.swap(); }}, this) }; this.core.$element.on(this.handlers); }; Animate.Defaults={ animateOut: false, animateIn: false }; Animate.prototype.swap=function (){ if(this.core.settings.items!==1){ return; } if(!$.support.animation||!$.support.transition){ return; } this.core.speed(0); var left, clear=$.proxy(this.clear, this), previous=this.core.$stage.children().eq(this.previous), next=this.core.$stage.children().eq(this.next), incoming=this.core.settings.animateIn, outgoing=this.core.settings.animateOut; if(this.core.current()===this.previous){ return; } if(outgoing){ left=this.core.coordinates(this.previous) - this.core.coordinates(this.next); previous.one($.support.animation.end, clear) .css({ 'left': left + 'px' }) .addClass('animated owl-animated-out') .addClass(outgoing); } if(incoming){ next.one($.support.animation.end, clear) .addClass('animated owl-animated-in') .addClass(incoming); }}; Animate.prototype.clear=function (e){ $(e.target).css({ 'left': '' }) .removeClass('animated owl-animated-out owl-animated-in') .removeClass(this.core.settings.animateIn) .removeClass(this.core.settings.animateOut); this.core.onTransitionEnd(); }; Animate.prototype.destroy=function (){ var handler, property; for (handler in this.handlers){ this.core.$element.off(handler, this.handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.owlCarousel.Constructor.Plugins.Animate=Animate; })(window.Zepto||window.jQuery, window, document); ; (function ($, window, document, undefined){ var Autoplay=function (carousel){ this._core=carousel; this._call=null; this._time=0; this._timeout=0; this._paused=true; this._handlers={ 'changed.owl.carousel': $.proxy(function (e){ if(e.namespace&&e.property.name==='settings'){ if(this._core.settings.autoplay){ this.play(); }else{ this.stop(); }}else if(e.namespace&&e.property.name==='position'&&this._paused){ this._time=0; }}, this), 'initialized.owl.carousel': $.proxy(function (e){ if(e.namespace&&this._core.settings.autoplay){ this.play(); }}, this), 'play.owl.autoplay': $.proxy(function (e, t, s){ if(e.namespace){ this.play(t, s); }}, this), 'stop.owl.autoplay': $.proxy(function (e){ if(e.namespace){ this.stop(); }}, this), 'mouseover.owl.autoplay': $.proxy(function (){ if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){ this.pause(); }}, this), 'mouseleave.owl.autoplay': $.proxy(function (){ if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){ this.play(); }}, this), 'touchstart.owl.core': $.proxy(function (){ if(this._core.settings.autoplayHoverPause&&this._core.is('rotating')){ this.pause(); }}, this), 'touchend.owl.core': $.proxy(function (){ if(this._core.settings.autoplayHoverPause){ this.play(); }}, this) }; this._core.$element.on(this._handlers); this._core.options=$.extend({}, Autoplay.Defaults, this._core.options); }; Autoplay.Defaults={ autoplay: false, autoplayTimeout: 5000, autoplayHoverPause: false, autoplaySpeed: false }; Autoplay.prototype._next=function (speed){ this._call=window.setTimeout($.proxy(this._next, this, speed), this._timeout * (Math.round(this.read() / this._timeout) + 1) - this.read() ); if(this._core.is('interacting')||document.hidden){ return; } this._core.next(speed||this._core.settings.autoplaySpeed); } Autoplay.prototype.read=function (){ return new Date().getTime() - this._time; }; Autoplay.prototype.play=function (timeout, speed){ var elapsed; if(!this._core.is('rotating')){ this._core.enter('rotating'); } timeout=timeout||this._core.settings.autoplayTimeout; elapsed=Math.min(this._time % (this._timeout||timeout), timeout); if(this._paused){ this._time=this.read(); this._paused=false; }else{ window.clearTimeout(this._call); } this._time +=this.read() % timeout - elapsed; this._timeout=timeout; this._call=window.setTimeout($.proxy(this._next, this, speed), timeout - elapsed); }; Autoplay.prototype.stop=function (){ if(this._core.is('rotating')){ this._time=0; this._paused=true; window.clearTimeout(this._call); this._core.leave('rotating'); }}; Autoplay.prototype.pause=function (){ if(this._core.is('rotating')&&!this._paused){ this._time=this.read(); this._paused=true; window.clearTimeout(this._call); }}; Autoplay.prototype.destroy=function (){ var handler, property; this.stop(); for (handler in this._handlers){ this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.owlCarousel.Constructor.Plugins.autoplay=Autoplay; })(window.Zepto||window.jQuery, window, document); ; (function ($, window, document, undefined){ 'use strict'; var Navigation=function (carousel){ this._core=carousel; this._initialized=false; this._pages=[]; this._controls={}; this._templates=[]; this.$element=this._core.$element; this._overrides={ next: this._core.next, prev: this._core.prev, to: this._core.to }; this._handlers={ 'prepared.owl.carousel': $.proxy(function (e){ if(e.namespace&&this._core.settings.dotsData){ this._templates.push('
' + $(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '
'); }}, this), 'added.owl.carousel': $.proxy(function (e){ if(e.namespace&&this._core.settings.dotsData){ this._templates.splice(e.position, 0, this._templates.pop()); }}, this), 'remove.owl.carousel': $.proxy(function (e){ if(e.namespace&&this._core.settings.dotsData){ this._templates.splice(e.position, 1); }}, this), 'changed.owl.carousel': $.proxy(function (e){ if(e.namespace&&e.property.name=='position'){ this.draw(); }}, this), 'initialized.owl.carousel': $.proxy(function (e){ if(e.namespace&&!this._initialized){ this._core.trigger('initialize', null, 'navigation'); this.initialize(); this.update(); this.draw(); this._initialized=true; this._core.trigger('initialized', null, 'navigation'); }}, this), 'refreshed.owl.carousel': $.proxy(function (e){ if(e.namespace&&this._initialized){ this._core.trigger('refresh', null, 'navigation'); this.update(); this.draw(); this._core.trigger('refreshed', null, 'navigation'); }}, this) }; this._core.options=$.extend({}, Navigation.Defaults, this._core.options); this.$element.on(this._handlers); }; Navigation.Defaults={ nav: false, navText: [ '', '' ], navSpeed: false, navElement: 'button type="button" role="presentation"', navContainer: false, navContainerClass: 'owl-nav', navClass: [ 'owl-prev', 'owl-next' ], slideBy: 1, dotClass: 'owl-dot', dotsClass: 'owl-dots', dots: true, dotsEach: false, dotsData: false, dotsSpeed: false, dotsContainer: false }; Navigation.prototype.initialize=function (){ var override, settings=this._core.settings; this._controls.$relative=(settings.navContainer ? $(settings.navContainer) : $('
').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled'); this._controls.$previous=$('<' + settings.navElement + '>') .addClass(settings.navClass[0]) .html(settings.navText[0]) .prependTo(this._controls.$relative) .on('click', $.proxy(function (e){ this.prev(settings.navSpeed); }, this)); this._controls.$next=$('<' + settings.navElement + '>') .addClass(settings.navClass[1]) .html(settings.navText[1]) .appendTo(this._controls.$relative) .on('click', $.proxy(function (e){ this.next(settings.navSpeed); }, this)); if(!settings.dotsData){ this._templates=[$('
').css(m).html(u)),t.show().data({naturalWidth:d||h.outerWidth(),naturalHeight:p||h.outerHeight()}).hide(),"function"==typeof a.callback.onRender&&a.callback.onRender.call(n,n.ui,i),"function"==typeof e.options.onRender&&e.options.onRender.call(n,r);var g=findImageInElement(t);n.loadImage(g,function(){"function"==typeof a.callback.onAfterLoad&&a.callback.onAfterLoad.call(n,n.ui,i),"function"==typeof e.options.onAfterLoad&&e.options.onAfterLoad.call(n,r),n.configureHolder(e,o,t)}),a.ajaxSetup.success(s,l,c),"function"==typeof f.success&&f.success(s,l,c)},error:function(s,l,c){"function"==typeof a.callback.onAfterLoad&&a.callback.onAfterLoad.call(n,n.ui,i),"function"==typeof e.options.onAfterLoad&&e.options.onAfterLoad.call(n,r),n.hideLoader(),$("div.ilightbox-container",t).empty().append(''+a.errors.loadContents+""),n.configureHolder(e,o,t),a.ajaxSetup.error(s,l,c),"function"==typeof f.error&&f.error(s,l,c)}});break;case"html":var m=e.URL;if(container=$("div.ilightbox-container",t),m[0].nodeName)h=m.clone();else{var g=$(m);h=g.selector?$("
"+g+"
"):g}var v=n.items[i].options.width||parseInt(h.attr("width")),b=n.items[i].options.height||parseInt(h.attr("height"));n.addContent(t,e),h.appendTo(document.documentElement).hide(),"function"==typeof a.callback.onRender&&a.callback.onRender.call(n,n.ui,i),"function"==typeof e.options.onRender&&e.options.onRender.call(n,r);p=findImageInElement(t);"function"==typeof a.callback.onBeforeLoad&&a.callback.onBeforeLoad.call(n,n.ui,i),"function"==typeof e.options.onBeforeLoad&&e.options.onBeforeLoad.call(n,r),n.loadImage(p,function(){"function"==typeof a.callback.onAfterLoad&&a.callback.onAfterLoad.call(n,n.ui,i),"function"==typeof e.options.onAfterLoad&&e.options.onAfterLoad.call(n,r),t.show().data({naturalWidth:v||container.outerWidth(),naturalHeight:b||container.outerHeight()}).hide(),h.remove(),n.configureHolder(e,o,t)})}},configureHolder:function(e,t,i){var o=this,n=o.vars,a=o.options;if("current"!=t&&("next"==t?i.addClass("ilightbox-next"):i.addClass("ilightbox-prev")),"current"==t)var r=n.current;else if("next"==t){var s=a.styles.nextOpacity;r=n.next}else s=a.styles.prevOpacity,r=n.prev;var l={element:i,position:r};o.items[r].options.width=o.items[r].options.width||0,o.items[r].options.height=o.items[r].options.height||0,"current"==t?a.show.effect?i.css(transform,gpuAcceleration).fadeIn(e.speed,function(){if(i.css(transform,""),e.caption){o.setCaption(e,i);var t=$("div.ilightbox-caption",i),n=parseInt(t.outerHeight()/i.outerHeight()*100);a.caption.start&n<=50&&t.fadeIn(a.effects.fadeSpeed)}var s=e.options.social;s&&(o.setSocial(s,e.URL,i),a.social.start&&$("div.ilightbox-social",i).fadeIn(a.effects.fadeSpeed)),o.generateThumbnails(),"function"==typeof a.callback.onShow&&a.callback.onShow.call(o,o.ui,r),"function"==typeof e.options.onShow&&e.options.onShow.call(o,l)}):(i.show(),o.generateThumbnails(),"function"==typeof a.callback.onShow&&a.callback.onShow.call(o,o.ui,r),"function"==typeof e.options.onShow&&e.options.onShow.call(o,l)):a.show.effect?i.fadeTo(e.speed,s,function(){"next"==t?n.nextLock=!1:n.prevLock=!1,o.generateThumbnails(),"function"==typeof a.callback.onShow&&a.callback.onShow.call(o,o.ui,r),"function"==typeof e.options.onShow&&e.options.onShow.call(o,l)}):(i.css({opacity:s}).show(),"next"==t?n.nextLock=!1:n.prevLock=!1,o.generateThumbnails(),"function"==typeof a.callback.onShow&&a.callback.onShow.call(o,o.ui,r),"function"==typeof e.options.onShow&&e.options.onShow.call(o,l)),setTimeout(function(){o.repositionPhoto()},0)},generateBoxes:function(){var e=this,t=e.vars,i=e.options;i.infinite&&t.total>=3?(t.current==t.total-1&&(t.next=0),0==t.current&&(t.prev=t.total-1)):i.infinite=!1,e.loadContent(e.items[t.current],"current",i.show.speed),e.items[t.next]&&e.loadContent(e.items[t.next],"next",i.show.speed),e.items[t.prev]&&e.loadContent(e.items[t.prev],"prev",i.show.speed)},generateThumbnails:function(){var e=this,t=e.vars,i=e.options,o=null;if(t.thumbs&&!e.vars.dontGenerateThumbs){var n=t.thumbnails,a=$("div.ilightbox-thumbnails-container",n),r=$("div.ilightbox-thumbnails-grid",a),s=0;r.removeAttr("style").empty(),$.each(e.items,function(l,c){var u=t.current==l?"ilightbox-active":"",h=t.current==l?i.thumbnails.activeOpacity:i.thumbnails.normalOpacity,d=c.options.thumbnail,p=$('
'),f=$('
');p.css({opacity:0}).addClass(u),"video"!=c.type&&"flash"!=c.type||void 0!==c.options.icon?c.options.icon&&(f.addClass("ilightbox-thumbnail-"+c.options.icon),p.append(f)):(f.addClass("ilightbox-thumbnail-video"),p.append(f)),d&&e.loadImage(d,function(t){s++,t?p.data({naturalWidth:t.width,naturalHeight:t.height}).append(''):p.data({naturalWidth:i.thumbnails.maxWidth,naturalHeight:i.thumbnails.maxHeight}),clearTimeout(o),o=setTimeout(function(){e.positionThumbnails(n,a,r)},20),setTimeout(function(){p.fadeTo(i.effects.loadedFadeSpeed,h)},20*s)}),r.append(p)}),e.vars.dontGenerateThumbs=!0}},positionThumbnails:function(e,t,i){var o=this,n=o.vars,a=o.options,r=getViewport(),s=a.path.toLowerCase();e||(e=n.thumbnails),t||(t=$("div.ilightbox-thumbnails-container",e)),i||(i=$("div.ilightbox-thumbnails-grid",t));var l=$(".ilightbox-thumbnail",i),c="horizontal"==s?r.width-a.styles.pageOffsetX:l.eq(0).outerWidth()-a.styles.pageOffsetX,u="horizontal"==s?l.eq(0).outerHeight()-a.styles.pageOffsetY:r.height-a.styles.pageOffsetY,h="horizontal"==s?0:c,d="horizontal"==s?u:0,p=$(".ilightbox-active",i),f={};arguments.length<3&&(l.css({opacity:a.thumbnails.normalOpacity}),p.css({opacity:a.thumbnails.activeOpacity})),l.each(function(e){var t=$(this),i=t.data(),n="horizontal"==s?0:a.thumbnails.maxWidth;height="horizontal"==s?a.thumbnails.maxHeight:0,dims=o.getNewDimenstions(n,height,i.naturalWidth,i.naturalHeight,!0),t.css({width:dims.width,height:dims.height}),"horizontal"==s&&t.css({float:"left"}),"horizontal"==s?h+=t.outerWidth(!0):d+=t.outerHeight()}),f={width:h,height:d},i.css(f),f={};var m=i.offset(),g=p.length?p.offset():{top:parseInt(u/2),left:parseInt(c/2)};m.top=m.top-$doc.scrollTop(),m.left=m.left-$doc.scrollLeft(),g.top=g.top-m.top-$doc.scrollTop(),g.left=g.left-m.left-$doc.scrollLeft(),"horizontal"==s?(f.top=0,f.left=parseInt(c/2-g.left-p.outerWidth()/2)):(f.top=parseInt(u/2-g.top-p.outerHeight()/2),f.left=0),arguments.length<3?i.stop().animate(f,a.effects.repositionSpeed,"easeOutCirc"):i.css(f)},loadImage:function(e,t){$.isArray(e)||(e=[e]);var i=this,o=e.length;o>0?(i.showLoader(),$.each(e,function(n,a){var r=new Image;r.onload=function(){0==(o-=1)&&(i.hideLoader(),t(r))},r.onerror=r.onabort=function(){0==(o-=1)&&(i.hideLoader(),t(!1))},r.src=e[n]})):t(!1)},patchItemsEvents:function(){var e=this,t=e.vars,i=supportTouch?"click.iL itap.iL":"click.iL",o=supportTouch?"click.iL itap.iL":"itap.iL";if(e.context&&e.selector){var n=$(e.selector,e.context);$(e.context).on(i,e.selector,function(){var i=$(this),o=n.index(i);return t.current=o,t.next=e.items[o+1]?o+1:null,t.prev=e.items[o-1]?o-1:null,e.addContents(),e.patchEvents(),!1}).on(o,e.selector,function(){return!1})}else $.each(e.itemsObject,function(n,a){a.on(i,function(){return t.current=n,t.next=e.items[n+1]?n+1:null,t.prev=e.items[n-1]?n-1:null,e.addContents(),e.patchEvents(),!1}).on(o,function(){return!1})})},dispatchItemsEvents:function(){var e=this;e.vars,e.options;e.context&&e.selector?$(e.context).off(".iL",e.selector):$.each(e.itemsObject,function(e,t){t.off(".iL")})},refresh:function(){this.dispatchItemsEvents(),this.attachItems(),this.normalizeItems(),this.patchItemsEvents()},patchEvents:function(){var e=this,t=e.vars,i=e.options,o=i.path.toLowerCase(),n=$(".ilightbox-holder"),a=fullScreenApi.fullScreenEventName+".iLightBox",r=verticalDistanceThreshold=100,s=[t.nextButton[0],t.prevButton[0],t.nextButton[0].firstChild,t.prevButton[0].firstChild];$win.bind("resize.iLightBox",function(){var o=getViewport();i.mobileOptimizer&&!i.innerToolbar&&(t.isMobile=o.width<=t.mobileMaxWidth),t.BODY[t.isMobile?"addClass":"removeClass"]("isMobile"),t.nextLock||t.prevLock||e.repositionPhoto(null),supportTouch&&(clearTimeout(t.setTime),t.setTime=setTimeout(function(){var e=getScrollXY().y;window.scrollTo(0,e-30),window.scrollTo(0,e+30),window.scrollTo(0,e)},2e3)),t.thumbs&&e.positionThumbnails()}).bind("keydown.iLightBox",function(o){if(i.controls.keyboard)switch(o.keyCode){case 13:o.shiftKey&&i.keyboard.shift_enter&&e.fullScreenAction();break;case 27:i.keyboard.esc&&e.closeAction();break;case 37:i.keyboard.left&&!t.lockKey&&e.moveTo("prev");break;case 38:i.keyboard.up&&!t.lockKey&&e.moveTo("prev");break;case 39:i.keyboard.right&&!t.lockKey&&e.moveTo("next");break;case 40:i.keyboard.down&&!t.lockKey&&e.moveTo("next")}}),fullScreenApi.supportsFullScreen&&$win.bind(a,function(){e.doFullscreen()});var l=[i.caption.show+".iLightBox",i.caption.hide+".iLightBox",i.social.show+".iLightBox",i.social.hide+".iLightBox"].filter(function(e,t,i){return i.lastIndexOf(e)===t}),c="";$.each(l,function(e,t){0!=e&&(c+=" "),c+=t}),$doc.on(clickEvent,".ilightbox-overlay",function(){i.overlay.blur&&e.closeAction()}).on(clickEvent,".ilightbox-next, .ilightbox-next-button",function(){e.moveTo("next")}).on(clickEvent,".ilightbox-prev, .ilightbox-prev-button",function(){e.moveTo("prev")}).on(clickEvent,".ilightbox-thumbnail",function(){var i=$(this),o=$(".ilightbox-thumbnail",t.thumbnails).index(i);o!=t.current&&e.goTo(o)}).on(c,".ilightbox-holder:not(.ilightbox-next, .ilightbox-prev)",function(e){var o=$("div.ilightbox-caption",t.holder),n=$("div.ilightbox-social",t.holder),a=i.effects.fadeSpeed;t.nextLock||t.prevLock?(e.type!=i.caption.show||o.is(":visible")?e.type==i.caption.hide&&o.is(":visible")&&o.fadeOut(a):o.fadeIn(a),e.type!=i.social.show||n.is(":visible")?e.type==i.social.hide&&n.is(":visible")&&n.fadeOut(a):n.fadeIn(a)):(e.type!=i.caption.show||o.is(":visible")?e.type==i.caption.hide&&o.is(":visible")&&o.stop().fadeOut(a):o.stop().fadeIn(a),e.type!=i.social.show||n.is(":visible")?e.type==i.social.hide&&n.is(":visible")&&n.stop().fadeOut(a):n.stop().fadeIn(a))}).on("mouseenter.iLightBox mouseleave.iLightBox",".ilightbox-wrapper",function(e){"mouseenter"==e.type?t.lockWheel=!0:t.lockWheel=!1}).on(clickEvent,".ilightbox-toolbar a.ilightbox-close, .ilightbox-toolbar a.ilightbox-fullscreen, .ilightbox-toolbar a.ilightbox-play, .ilightbox-toolbar a.ilightbox-pause",function(){var t=$(this);t.hasClass("fusion-updated")||(t.hasClass("ilightbox-fullscreen")?e.fullScreenAction():t.hasClass("ilightbox-play")?(e.resume(),t.addClass("ilightbox-pause").removeClass("ilightbox-play")):t.hasClass("ilightbox-pause")?(e.pause(),t.addClass("ilightbox-play").removeClass("ilightbox-pause")):e.closeAction(),t.addClass("fusion-updated"),setTimeout(function(){t.removeClass("fusion-updated")},100))}).on(touchMoveEvent,".ilightbox-overlay, .ilightbox-thumbnails-container",function(e){e.preventDefault()}),i.controls.arrows&&!supportTouch&&$doc.on("mousemove.iLightBox",function(e){t.isMobile||(t.mouseID||t.hideableElements.show(),t.mouseID=clearTimeout(t.mouseID),-1===s.indexOf(e.target)&&(t.mouseID=setTimeout(function(){t.hideableElements.hide(),t.mouseID=clearTimeout(t.mouseID)},3e3)))}),i.controls.slideshow&&i.slideshow.pauseOnHover&&$doc.on("mouseenter.iLightBox mouseleave.iLightBox",".ilightbox-holder:not(.ilightbox-next, .ilightbox-prev)",function(i){"mouseenter"==i.type&&t.cycleID?e.pause():"mouseleave"==i.type&&t.isPaused&&e.resume()});var u=$(".ilightbox-overlay, .ilightbox-holder, .ilightbox-thumbnails");i.controls.mousewheel&&u.on("mousewheel.iLightBox",function(i,o){t.lockWheel||(i.preventDefault(),o<0?e.moveTo("next"):o>0&&e.moveTo("prev"))}),i.controls.swipe&&n.on(touchStartEvent,function(a){if(!(t.nextLock||t.prevLock||1==t.total||t.lockSwipe)){t.BODY.addClass("ilightbox-closedhand");var s,l=a.originalEvent.touches?a.originalEvent.touches[0]:a,c=$doc.scrollTop(),u=$doc.scrollLeft(),h=[n.eq(0).offset(),n.eq(1).offset(),n.eq(2).offset()],d=[{top:h[0].top-c,left:h[0].left-u},{top:h[1].top-c,left:h[1].left-u},{top:h[2].top-c,left:h[2].left-u}],p={time:(new Date).getTime(),coords:[l.pageX-u,l.pageY-c]};n.bind(touchMoveEvent,m),$doc.one(touchStopEvent,function(a){n.unbind(touchMoveEvent,m),t.BODY.removeClass("ilightbox-closedhand"),p&&s&&("horizontal"==o&&s.time-p.time<1e3&&abs(p.coords[0]-s.coords[0])>r&&abs(p.coords[1]-s.coords[1])s.coords[0]?t.current!=t.total-1||i.infinite?(t.isSwipe=!0,e.moveTo("next")):g():0!=t.current||i.infinite?(t.isSwipe=!0,e.moveTo("prev")):g():"vertical"==o&&s.time-p.time<1e3&&abs(p.coords[1]-s.coords[1])>r&&abs(p.coords[0]-s.coords[0])s.coords[1]?t.current!=t.total-1||i.infinite?(t.isSwipe=!0,e.moveTo("next")):g():0!=t.current||i.infinite?(t.isSwipe=!0,e.moveTo("prev")):g():g()),p=s=undefined})}function f(e){var t=$(this),i=d[e],n=[p.coords[0]-s.coords[0],p.coords[1]-s.coords[1]];t[0].style["horizontal"==o?"left":"top"]=("horizontal"==o?i.left-n[0]:i.top-n[1])+"px"}function m(e){if(p){var t=e.originalEvent.touches?e.originalEvent.touches[0]:e;s={time:(new Date).getTime(),coords:[t.pageX-u,t.pageY-c]},n.each(f),e.preventDefault()}}function g(){n.each(function(){var e=$(this),t=e.data("offset")||{top:e.offset().top-c,left:e.offset().left-u},i=t.top,o=t.left;e.css(transform,gpuAcceleration).stop().animate({top:i,left:o},500,"easeOutCirc",function(){e.css(transform,"")})})}})},goTo:function(e){var t=this,i=t.vars,o=t.options,n=e-i.current;if(o.infinite&&(e==i.total-1&&0==i.current&&(n=-1),i.current==i.total-1&&0==e&&(n=1)),1==n)t.moveTo("next");else if(-1==n)t.moveTo("prev");else{if(i.nextLock||i.prevLock)return!1;"function"==typeof o.callback.onBeforeChange&&o.callback.onBeforeChange.call(t,t.ui),o.linkId&&(i.hashLock=!0,window.location.hash=o.linkId+"/"+e),t.items[e]&&(t.items[e].options.mousewheel?t.vars.lockWheel=!1:i.lockWheel=!0,t.items[e].options.swipe?i.lockSwipe=!1:i.lockSwipe=!0),$.each([i.holder,i.nextPhoto,i.prevPhoto],function(e,t){t.css(transform,gpuAcceleration).fadeOut(o.effects.loadedFadeSpeed)}),i.current=e,i.next=e+1,i.prev=e-1,t.createUI(),setTimeout(function(){t.generateBoxes()},o.effects.loadedFadeSpeed+50),$(".ilightbox-thumbnail",i.thumbnails).removeClass("ilightbox-active").eq(e).addClass("ilightbox-active"),t.positionThumbnails(),o.linkId&&setTimeout(function(){i.hashLock=!1},55),o.infinite||(i.nextButton.add(i.prevButton).add(i.innerPrevButton).add(i.innerNextButton).removeClass("disabled"),0==i.current&&i.prevButton.add(i.innerPrevButton).addClass("disabled"),i.current>=i.total-1&&i.nextButton.add(i.innerNextButton).addClass("disabled")),t.resetCycle(),"function"==typeof o.callback.onAfterChange&&o.callback.onAfterChange.call(t,t.ui)}},moveTo:function(e){var t=this,i=t.vars,o=t.options,n=o.path.toLowerCase(),a=getViewport(),r=o.effects.switchSpeed,s=t.vars.holder,l=s.find("iframe").length?s.find("iframe").attr("src"):"";if(l&&-1!==l.indexOf("vimeo.com")&&s.find("iframe").attr("src",l),i.nextLock||i.prevLock)return!1;var c="next"==e?i.next:i.prev;if(o.linkId&&c&&(i.hashLock=!0,window.location.hash=o.linkId+"/"+c),"next"==e){if(!t.items[c])return!1;var u=i.nextPhoto,h=i.holder,d=i.prevPhoto,p="ilightbox-prev",f="ilightbox-next"}else if("prev"==e){if(!t.items[c])return!1;u=i.prevPhoto,h=i.holder,d=i.nextPhoto,p="ilightbox-next",f="ilightbox-prev"}"function"==typeof o.callback.onBeforeChange&&o.callback.onBeforeChange.call(t,t.ui),"next"==e?i.nextLock=!0:i.prevLock=!0;var m=$("div.ilightbox-caption",h),g=$("div.ilightbox-social",h);if(m.length&&m.stop().fadeOut(r,function(){$(this).remove()}),g.length&&g.stop().fadeOut(r,function(){$(this).remove()}),t.items[c].caption){t.setCaption(t.items[c],u);var v=$("div.ilightbox-caption",u),b=parseInt(v.outerHeight()/u.outerHeight()*100);o.caption.start&&b<=50&&v.fadeIn(r)}var x=t.items[c].options.social;x&&(t.setSocial(x,t.items[c].URL,u),o.social.start&&$("div.ilightbox-social",u).fadeIn(o.effects.fadeSpeed)),$.each([u,h,d],function(e,t){t.removeClass("ilightbox-next ilightbox-prev")});var w=u.data("offset"),y=a.width-o.styles.pageOffsetX,k=a.height-o.styles.pageOffsetY,S=w.newDims.width,L=w.newDims.height,T=w.thumbsOffset,A=w.diff,I=parseInt(k/2-L/2-A.H-T.H/2),C=parseInt(y/2-S/2-A.W-T.W/2);u.css(transform,gpuAcceleration).animate({top:I,left:C,opacity:1},r,i.isSwipe?"easeOutCirc":"easeInOutCirc",function(){u.css(transform,"")}),$("div.ilightbox-container",u).animate({width:S,height:L},r,i.isSwipe?"easeOutCirc":"easeInOutCirc");var O=h.data("offset"),B=O.object;A=O.diff,S=O.newDims.width,L=O.newDims.height,S=parseInt(S*o.styles["next"==e?"prevScale":"nextScale"]),L=parseInt(L*o.styles["next"==e?"prevScale":"nextScale"]),I="horizontal"==n?parseInt(k/2-B.offsetY-L/2-A.H-T.H/2):parseInt(k-B.offsetX-A.H-T.H/2),"prev"==e?C="horizontal"==n?parseInt(y-B.offsetX-A.W-T.W/2):parseInt(y/2-S/2-A.W-B.offsetY-T.W/2):(I="horizontal"==n?I:parseInt(B.offsetX-A.H-L-T.H/2),C="horizontal"==n?parseInt(B.offsetX-A.W-S-T.W/2):parseInt(y/2-B.offsetY-S/2-A.W-T.W/2)),$("div.ilightbox-container",h).animate({width:S,height:L},r,i.isSwipe?"easeOutCirc":"easeInOutCirc"),h.addClass(p).css(transform,gpuAcceleration).animate({top:I,left:C,opacity:o.styles.prevOpacity},r,i.isSwipe?"easeOutCirc":"easeInOutCirc",function(){h.css(transform,""),$(".ilightbox-thumbnail",i.thumbnails).removeClass("ilightbox-active").eq(c).addClass("ilightbox-active"),t.positionThumbnails(),t.items[c]&&(t.items[c].options.mousewheel?i.lockWheel=!1:i.lockWheel=!0,t.items[c].options.swipe?i.lockSwipe=!1:i.lockSwipe=!0),i.isSwipe=!1,"next"==e?(i.nextPhoto=d,i.prevPhoto=h,i.holder=u,i.nextPhoto.hide(),i.next=i.next+1,i.prev=i.current,i.current=i.current+1,o.infinite&&(i.current>i.total-1&&(i.current=0),i.current==i.total-1&&(i.next=0),0==i.current&&(i.prev=i.total-1)),t.createUI(),t.items[i.next]?t.loadContent(t.items[i.next],"next"):i.nextLock=!1):(i.prevPhoto=d,i.nextPhoto=h,i.holder=u,i.prevPhoto.hide(),i.next=i.current,i.current=i.prev,i.prev=i.current-1,o.infinite&&(i.current==i.total-1&&(i.next=0),0==i.current&&(i.prev=i.total-1)),t.createUI(),t.items[i.prev]?t.loadContent(t.items[i.prev],"prev"):i.prevLock=!1),o.linkId&&setTimeout(function(){i.hashLock=!1},55),o.infinite||(i.nextButton.add(i.prevButton).add(i.innerPrevButton).add(i.innerNextButton).removeClass("disabled"),0==i.current&&i.prevButton.add(i.innerPrevButton).addClass("disabled"),i.current>=i.total-1&&i.nextButton.add(i.innerNextButton).addClass("disabled")),t.repositionPhoto(),t.resetCycle(),"function"==typeof o.callback.onAfterChange&&o.callback.onAfterChange.call(t,t.ui)}),I="horizontal"==n?getPixel(d,"top"):"next"==e?parseInt(-k/2-d.outerHeight()):parseInt(2*I),C="horizontal"==n?"next"==e?parseInt(-y/2-d.outerWidth()):parseInt(2*C):getPixel(d,"left"),d.css(transform,gpuAcceleration).animate({top:I,left:C,opacity:o.styles.nextOpacity},r,i.isSwipe?"easeOutCirc":"easeInOutCirc",function(){d.css(transform,"")}).addClass(f)},setCaption:function(e,t){var i=$('
');e.caption&&(i.html(e.caption),$("div.ilightbox-container",t).append(i))},normalizeSocial:function(e,t){this.vars;var i=this.options,o=window.location.href;return $.each(e,function(n,a){if(!a)return!0;var r,s;switch(n.toLowerCase()){case"facebook":r="http://www.facebook.com/share.php?v=4&src=bm&u={URL}",s="Share on Facebook";break;case"twitter":r="http://twitter.com/home?status={URL}",s="Share on Twitter";break;case"delicious":r="http://delicious.com/post?url={URL}",s="Share on Delicious";break;case"digg":r="http://digg.com/submit?phase=2&url={URL}",s="Share on Digg";break;case"reddit":r="http://reddit.com/submit?url={URL}",s="Share on reddit"}e[n]={URL:a.URL&&absolutizeURI(o,a.URL)||i.linkId&&window.location.href||"string"!=typeof t&&o||t&&absolutizeURI(o,t)||o,source:a.source||r||a.URL&&absolutizeURI(o,a.URL)||t&&absolutizeURI(o,t),text:a.text||s||"Share on "+n,width:void 0===a.width||isNaN(a.width)?640:parseInt(a.width),height:a.height||360}}),e},setSocial:function(e,t,i){var o=$('
'),n="
    ";e=this.normalizeSocial(e,t),$.each(e,function(e,t){e.toLowerCase();var i=t.source.replace(/\{URL\}/g,encodeURIComponent(t.URL).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+"));n+='
  • '}),n+="
",o.html(n),$("div.ilightbox-container",i).append(o)},fullScreenAction:function(){this.vars;fullScreenApi.supportsFullScreen?fullScreenApi.isFullScreen()?fullScreenApi.cancelFullScreen(document.documentElement):fullScreenApi.requestFullScreen(document.documentElement):this.doFullscreen()},doFullscreen:function(){var e=this,t=e.vars,i=getViewport(),o=e.options;if(o.fullAlone){var n=t.holder,a=e.items[t.current],r=i.width,s=i.height,l=[n,t.nextPhoto,t.prevPhoto,t.nextButton,t.prevButton,t.overlay,t.toolbar,t.thumbnails,t.loader],c=[t.loader,t.thumbnails];if(t.isInFullScreen)t.isInFullScreen=t.lockKey=t.lockWheel=t.lockSwipe=!1,t.overlay.css({opacity:e.options.overlay.opacity}),$.each(c,function(e,t){t.show()}),t.fullScreenButton.attr("title",o.text.enterFullscreen),n.data({naturalWidth:n.data("naturalWidthOld"),naturalHeight:n.data("naturalHeightOld"),naturalWidthOld:null,naturalHeightOld:null}),$.each(l,function(e,t){t.removeClass("ilightbox-fullscreen")}),"function"==typeof o.callback.onExitFullScreen&&o.callback.onExitFullScreen.call(e,e.ui);else{if(t.isInFullScreen=t.lockKey=t.lockWheel=t.lockSwipe=!0,t.overlay.css({opacity:1}),$.each(c,function(e,t){t.hide()}),t.fullScreenButton.attr("title",o.text.exitFullscreen),-1!=o.fullStretchTypes.indexOf(a.type))n.data({naturalWidthOld:n.data("naturalWidth"),naturalHeightOld:n.data("naturalHeight"),naturalWidth:r,naturalHeight:s});else{i=a.options.fullViewPort||o.fullViewPort||"";var u=r,h=s,d=n.data("naturalWidth"),p=n.data("naturalHeight");if("fill"==i.toLowerCase())(h=u/d*p)u||p>h;u=(f=e.getNewDimenstions(u,h,d,p,m)).width,h=f.height}n.data({naturalWidthOld:n.data("naturalWidth"),naturalHeightOld:n.data("naturalHeight"),naturalWidth:u,naturalHeight:h})}$.each(l,function(e,t){t.addClass("ilightbox-fullscreen")}),"function"==typeof o.callback.onEnterFullScreen&&o.callback.onEnterFullScreen.call(e,e.ui)}}else t.isInFullScreen?t.isInFullScreen=!1:t.isInFullScreen=!0;e.repositionPhoto(!0)},closeAction:function(){var e=this.vars,t=this.options;$win.unbind(".iLightBox"),$doc.off(".iLightBox"),$doc.off(clickEvent,".ilightbox-overlay"),$doc.off(clickEvent,".ilightbox-next, .ilightbox-next-button"),$doc.off(clickEvent,".ilightbox-prev, .ilightbox-prev-button"),$doc.off(clickEvent,".ilightbox-thumbnail"),$doc.off(clickEvent,".ilightbox-toolbar a.ilightbox-close, .ilightbox-toolbar a.ilightbox-fullscreen, .ilightbox-toolbar a.ilightbox-play, .ilightbox-toolbar a.ilightbox-pause"),e.isInFullScreen&&fullScreenApi.cancelFullScreen(document.documentElement),$(".ilightbox-overlay, .ilightbox-holder, .ilightbox-thumbnails").off(".iLightBox"),t.hide.effect?e.overlay.stop().fadeOut(t.hide.speed,function(){e.overlay.remove(),e.BODY.removeClass("ilightbox-noscroll").off(".iLightBox")}):(e.overlay.remove(),e.BODY.removeClass("ilightbox-noscroll").off(".iLightBox"));var i=[e.toolbar,e.holder,e.nextPhoto,e.prevPhoto,e.nextButton,e.prevButton,e.loader,e.thumbnails];$.each(i,function(e,t){t.removeAttr("style").remove()}),e.prevButton.removeClass("disabled"),e.nextButton.removeClass("disabled"),e.dontGenerateThumbs=e.isInFullScreen=!1,window.iLightBox=null,t.linkId&&(e.hashLock=!0,removeHash(),setTimeout(function(){e.hashLock=!1},55)),"function"==typeof t.callback.onHide&&t.callback.onHide.call(this,this.ui)},repositionPhoto:function(){var e=this,t=e.vars,i=e.options,o=i.path.toLowerCase(),n=getViewport(),a=n.width,r=n.height,s=t.isInFullScreen&&i.fullAlone||t.isMobile?0:"horizontal"==o?0:t.thumbnails.outerWidth(),l=t.isMobile?t.toolbar.outerHeight():t.isInFullScreen&&i.fullAlone?0:"horizontal"==o?t.thumbnails.outerHeight():0,c=t.isInFullScreen&&i.fullAlone?a:a-i.styles.pageOffsetX,u=t.isInFullScreen&&i.fullAlone?r:r-i.styles.pageOffsetY,h="horizontal"==o?parseInt(e.items[t.next]||e.items[t.prev]?2*(i.styles.nextOffsetX+i.styles.prevOffsetX):c/10<=30?30:c/10):parseInt(c/10<=30?30:c/10)+s,d="horizontal"==o?parseInt(u/10<=30?30:u/10)+l:parseInt(e.items[t.next]||e.items[t.prev]?2*(i.styles.nextOffsetX+i.styles.prevOffsetX):u/10<=30?30:u/10),p={type:"current",width:c,height:u,item:e.items[t.current],offsetW:h,offsetH:d,thumbsOffsetW:s,thumbsOffsetH:l,animate:arguments.length,holder:t.holder};e.repositionEl(p),e.items[t.next]&&(p=$.extend(p,{type:"next",item:e.items[t.next],offsetX:i.styles.nextOffsetX,offsetY:i.styles.nextOffsetY,holder:t.nextPhoto}),e.repositionEl(p)),e.items[t.prev]&&(p=$.extend(p,{type:"prev",item:e.items[t.prev],offsetX:i.styles.prevOffsetX,offsetY:i.styles.prevOffsetY,holder:t.prevPhoto}),e.repositionEl(p));var f="horizontal"==o?{left:parseInt(c/2-t.loader.outerWidth()/2)}:{top:parseInt(u/2-t.loader.outerHeight()/2)};t.loader.css(f)},repositionEl:function(e){var t=this.vars,i=this.options,o=i.path.toLowerCase(),n="current"==e.type&&t.isInFullScreen&&i.fullAlone?e.width:e.width-e.offsetW,a="current"==e.type&&t.isInFullScreen&&i.fullAlone?e.height:e.height-e.offsetH,r=e.item,s=e.item.options,l=e.holder,c=e.offsetX||0,u=e.offsetY||0,h=e.thumbsOffsetW,d=e.thumbsOffsetH;"current"==e.type?("number"==typeof s.width&&s.width&&(n=t.isInFullScreen&&i.fullAlone&&(-1!=i.fullStretchTypes.indexOf(r.type)||s.fullViewPort||i.fullViewPort)?n:s.width>n?n:s.width),"number"==typeof s.height&&s.height&&(a=t.isInFullScreen&&i.fullAlone&&(-1!=i.fullStretchTypes.indexOf(r.type)||s.fullViewPort||i.fullViewPort)?a:s.height>a?a:s.height)):("number"==typeof s.width&&s.width&&(n=s.width>n?n:s.width),"number"==typeof s.height&&s.height&&(a=s.height>a?a:s.height)),a=parseInt(a-$(".ilightbox-inner-toolbar",l).outerHeight());var p="string"==typeof s.width&&-1!=s.width.indexOf("%")?percentToValue(parseInt(s.width.replace("%","")),e.width):l.data("naturalWidth"),f="string"==typeof s.height&&-1!=s.height.indexOf("%")?percentToValue(parseInt(s.height.replace("%","")),e.height):l.data("naturalHeight"),m="string"==typeof s.width&&-1!=s.width.indexOf("%")||"string"==typeof s.height&&-1!=s.height.indexOf("%")?{width:p,height:f}:this.getNewDimenstions(n,a,p,f),g=$.extend({},m,{});"prev"==e.type||"next"==e.type?(p=parseInt(m.width*("next"==e.type?i.styles.nextScale:i.styles.prevScale)),f=parseInt(m.height*("next"==e.type?i.styles.nextScale:i.styles.prevScale))):(p=m.width,f=m.height);var v=parseInt((getPixel(l,"padding-left")+getPixel(l,"padding-right")+getPixel(l,"border-left-width")+getPixel(l,"border-right-width"))/2),b=parseInt((getPixel(l,"padding-top")+getPixel(l,"padding-bottom")+getPixel(l,"border-top-width")+getPixel(l,"border-bottom-width")+($(".ilightbox-inner-toolbar",l).outerHeight()||0))/2);switch(e.type){case"current":var x=parseInt(e.height/2-f/2-b-d/2),w=parseInt(e.width/2-p/2-v-h/2);break;case"next":x="horizontal"==o?parseInt(e.height/2-u-f/2-b-d/2):parseInt(e.height-c-b-d/2),w="horizontal"==o?parseInt(e.width-c-v-h/2):parseInt(e.width/2-p/2-v-u-h/2);break;case"prev":x="horizontal"==o?parseInt(e.height/2-u-f/2-b-d/2):parseInt(c-b-f-d/2),w="horizontal"==o?parseInt(c-v-p-h/2):parseInt(e.width/2-u-p/2-v-h/2)}l.data("offset",{top:x,left:w,newDims:g,diff:{W:v,H:b},thumbsOffset:{W:h,H:d},object:e}),e.animate>0&&i.effects.reposition?(l.css(transform,gpuAcceleration).stop().animate({top:x,left:w},i.effects.repositionSpeed,"easeOutCirc",function(){l.css(transform,"")}),$("div.ilightbox-container",l).stop().animate({width:p,height:f},i.effects.repositionSpeed,"easeOutCirc"),$("div.ilightbox-inner-toolbar",l).stop().animate({width:p},i.effects.repositionSpeed,"easeOutCirc",function(){$(this).css("overflow","visible")})):(l.css({top:x,left:w}),$("div.ilightbox-container",l).css({width:p,height:f}),$("div.ilightbox-inner-toolbar",l).css({width:p}))},resume:function(e){var t=this,i=t.vars,o=t.options;!o.slideshow.pauseTime||o.controls.slideshow&&i.total<=1||ea.options.maxScale?factor=a.options.maxScale:factor=0,html5H264:!(!e.canPlayType||!e.canPlayType("video/mp4").replace(/no/,"")),html5WebM:!(!e.canPlayType||!e.canPlayType("video/webm").replace(/no/,"")),html5Vorbis:!(!e.canPlayType||!e.canPlayType("video/ogg").replace(/no/,"")),html5QuickTime:!(!e.canPlayType||!e.canPlayType("video/quicktime").replace(/no/,""))}},addContent:function(e,t){var i=this;switch(t.type){case"video":var o=!1,n=t.videoType,a=t.options.html5video;("video/mp4"==n||"mp4"==t.ext||"m4v"==t.ext||a.h264)&&i.plugins.html5H264?(t.ext="mp4",t.URL=a.h264||t.URL):a.webm&&i.plugins.html5WebM?(t.ext="webm",t.URL=a.webm||t.URL):a.ogg&&i.plugins.html5Vorbis&&(t.ext="ogv",t.URL=a.ogg||t.URL),!i.plugins.html5H264||"video/mp4"!=n&&"mp4"!=t.ext&&"m4v"!=t.ext?!i.plugins.html5WebM||"video/webm"!=n&&"webm"!=t.ext?!i.plugins.html5Vorbis||"video/ogg"!=n&&"ogv"!=t.ext?!i.plugins.html5QuickTime||"video/quicktime"!=n&&"mov"!=t.ext&&"qt"!=t.ext||(o=!0,n="video/quicktime"):(o=!0,n="video/ogg"):(o=!0,n="video/webm"):(o=!0,n="video/mp4"),o?g=$("